package com.sunreal.paygateway.sys.exception;


/**
 * 业务级异常
 *
 * @author Lijp
 */
@SuppressWarnings("serial")
public class BusinessException extends Exception {
    private String errMsg;
    private int errCode;

    public BusinessException(int errCode, String errMsg) {
        this.errMsg = errMsg;
        this.errCode = errCode;
    }

    public BusinessException(WebErrCode webErrCode) {
        this.errMsg = webErrCode.getErroMsg();
        this.errCode = webErrCode.getErroCode();
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public BusinessException setErrMsg(String errMsg) {
        this.errMsg = errMsg;
        return this;
    }

    public int getErrCode() {
        return errCode;
    }

    public BusinessException setErrCode(int errCode) {
        this.errCode = errCode;
        return this;
    }

    @Override
    public String getMessage() {
        return errMsg;
    }


}
